Add test results summary and group logs - #63
Conversation
|
Is there a way to run .m test files in a particular order? |
I don't totally understand which test this is causing problems for (maybe you can comment directly on that code block so we don't have to keep quote replying this thread), but I wonder if updating the function calls to be less dependent on global state and more flexible for testing will help us come up with a better solution. Requiring things to happen in a particular order, using workarounds that customers might not be using or be aware of, feels like a bit of a code smell. |
|
Adding Houman as a reviewer since we're adding user-visible messages. |
Thank you, Sam. @mw-kapilg: Can you point me to the file(s) including the new user-facing text/messages? |
sameagen-MW
left a comment
There was a problem hiding this comment.
Looking good, thanks so much for your effort here! I think refactoring the environment variable readinging into index.ts is the biggest thing for me.
| methods (Access=protected) | ||
| function reportFinalizedSuite(plugin, pluginData) | ||
| % Checkout MATLAB Test license | ||
| license('checkout', 'matlab_test'); |
There was a problem hiding this comment.
Should the license be manually returned? Or will it be returned automatically after this method finishes.
| methods | ||
| function plugins = providePlugins(~, ~) | ||
| plugins = ciplugins.github.GitHubLogPlugin(); | ||
| end | ||
| end |
There was a problem hiding this comment.
Did we end up backporting service location @davidbuzinski? Otherwise, will we need to document that this feature is only suppored for R2024a (iirc?) and forward?
| try { | ||
| const helpLink = `<a href="https://github.com/matlab-actions/run-tests/blob/main/README.md"` + | ||
| ` target="_blank" title="View documentation">ℹ️</a>`; | ||
| const header = getTestHeader(testResults, stats); | ||
| const detailedResults = getDetailedResults(testResults); | ||
|
|
||
| core.summary | ||
| .addHeading('MATLAB Test Results (' + process.env.GITHUB_ACTION + ') ' + helpLink) | ||
| .addRaw(header, true) | ||
| .addHeading('All tests', 3) | ||
| .addRaw(detailedResults, true) | ||
| .write(); | ||
| } catch (e) { | ||
| console.error('An error occurred while adding the test results to the summary:', e); | ||
| } |
There was a problem hiding this comment.
What here can actually throw? We should try to keep the try block as tightly scoped as possible, only containing things that can actually fair for readability.
NOTE: Not ready to be merged into main branch, awaiting release of genscript's new version
This feature creates an in-platform summary for MATLAB test results if the user has a MATLAB Test license. Once the new
scriptgenversion is live, a small portion of the code will be updated (added comments for same) before release.Key highlights:
P.S. These functions would also be utilized in
run-commandandrun-buildactions to the generate test results summarySome additional changes:
run-buildtask grouping)Old:

New:

